from django.conf.urls import url, include

from rest_framework.routers import DefaultRouter, SimpleRouter
from rest_framework_jwt.views import obtain_jwt_token

from apps.users import views
from apps.users.views import UserViewset, SmsCodeViewset, LoginAuthorizeView

urlpatterns = [
    url(r'^login/$', views.LoginView.as_view(), name='login'),
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^loginpost/$', LoginAuthorizeView.as_view()),

]

route = SimpleRouter()
# 配置手机验证码发送 的 url
route.register(r'codes', SmsCodeViewset, basename="codes")
# 注册验证
route.register(r'users', UserViewset, basename="users")

urlpatterns += route.urls
